#ifndef GRAPHICALELEMENT_H_
#define GRAPHICALELEMENT_H_

#include "NetworkEvent.h"
#include "GraphicsWrapper.h"
#include "Texture.h"
#include "Animation.h"

class GraphicalElement
{
public:
    GraphicalElement();
    GraphicalElement(long id);
    virtual ~GraphicalElement();

    virtual void render(const Position& parent);
    virtual GraphicalElement* findChild(long idToFind);
    virtual void traverse(const Event& event);
    virtual void update(unsigned long tick);
    long getId();

    void setTexture(Texture* newTexture);
    Texture* getTexture();
    void deleteTexture();

    void setPosition(const Position& newPosition);
    Position getPosition();
    void setAnimation(Animation* animation);

protected:
    virtual void handleEvent(const Event& event);

private:
    long id;
    Texture* texture;
    Position position;
    NetworkEvents eventsToSend;
    Animation* animation;
};

#endif
